/*
 * 作者：姚俊
 * 功能：修改权限的aciton
 * 日期：2015-06-05
 */
package admin.action.baseInfo;

import admin.service.member.TeacherService;
import teacher.bean.Teacher;

public class AuthorityAction {
	
	private Teacher teacher1;
	private Teacher teacher;
	private int power;

	public Teacher getTeacher1() {
		return teacher1;
	}

	public void setTeacher1(Teacher teacher1) {
		this.teacher1 = teacher1;
	}
	
	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	public int getPower() {
		return power;
	}

	public void setPower(int power) {
		this.power = power;
	}

	public String execute()
	{
		Teacher tea=new TeacherService().getTeacher(this.getTeacher1());
		System.out.println("teacher1的权限为:"+this.getTeacher1().getPower());
		System.out.println("teacher1的Id为:"+this.getTeacher1().getTeaId());
		tea.setPower(this.getTeacher1().getPower());
		this.setTeacher(tea);
		System.out.println("当前权限为:"+tea.getPower());
		new TeacherService().updateTeacher(tea, this.getTeacher1());
		this.setPower(1);
		return "succ";
	}

}
